package main

import (
	"log"
	"net/http"

	"github.com/gorilla/mux"
)

// https://www.twilio.com/en-us/blog/developers/community/a-practical-guide-to-creating-microservices-with-go-micro
func main() {
	router := mux.NewRouter()
	router.Use(loggingMiddleware)
	router.Use(rateLimitingMiddleware)

	SetupRouting(router, services)
	router.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		w.WriteHeader(http.StatusOK)
		w.Write([]byte("API Gateway is running!"))
	})

	log.Fatal(http.ListenAndServe(":8000", router))
}
